#include <cstdio>

typedef long long ll;
int n;
ll b[61];

inline void insert(ll x) {
  for (int i = 60; ~i; --i)
    if ((x >> i) & 1)
      if (!b[i]) {
        b[i] = x;
        break;
      } else
        x ^= b[i];
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#endif
#ifndef LOCAL
  freopen("LinerBase.in", "r", stdin);
  freopen("LinerBase.out", "w", stdout);
#endif
#endif

  scanf("%d", &n);
  ll tmp = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &tmp);
    insert(tmp);
  }
  ll ans = 0;
  for (int i = 60; ~i; --i)
    if (ans < (ans ^ b[i])) ans ^= b[i];
  printf("%lld", ans);
  return 0;
}